<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>购物车 | BRUTAL TOYS 粗野主义潮玩</title>
    <style>
        /* 基础重置与粗野主义风格变量 */
        :root {
            --concrete: #7D7D7D;
            --concrete-light: #9E9E9E;
            --concrete-dark: #616161;
            --accent: #FF5252;
            --accent-dark: #E53935;
            --text: #212121;
            --text-light: #757575;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Helvetica Neue', Arial, sans-serif;
            background-color: #f5f5f5;
            color: var(--text);
            line-height: 1.6;
            background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h100v100H0z' fill='%23f5f5f5'/%3E%3Cpath d='M0 0v100M20 0v100M40 0v100M60 0v100M80 0v100M100 0v100M0 0h100M0 20h100M0 40h100M0 60h100M0 80h100M0 100h100' stroke='%23e0e0e0' stroke-width='1' fill='none'/%3E%3C/svg%3E");
        }

        .concrete-bg {
            background-color: var(--concrete);
            background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.2'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
            color: white;
            border: 2px solid var(--concrete-dark);
            box-shadow: 8px 8px 0 var(--concrete-dark);
        }

        /* 布局组件 */
        .container {
            width: 90%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }

        header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 30px 0;
            margin-bottom: 20px;
        }

        .logo {
            font-size: 2.5rem;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: -2px;
            color: var(--text);
        }

        .logo span {
            color: var(--accent);
        }

        nav ul {
            display: flex;
            list-style: none;
        }

        nav li {
            margin-left: 30px;
        }

        nav a {
            text-decoration: none;
            color: var(--text);
            font-weight: 600;
            text-transform: uppercase;
            font-size: 1.1rem;
            position: relative;
            padding: 5px 0;
        }

        nav a:after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 0;
            height: 3px;
            background-color: var(--accent);
            transition: width 0.3s;
        }

        nav a:hover:after {
            width: 100%;
        }

        /* 购物车布局 */
        .cart-container {
            display: grid;
            grid-template-columns: 1fr 350px;
            gap: 40px;
            margin-bottom: 60px;
        }

        /* 购物车标题 */
        .page-header {
            margin-bottom: 30px;
        }

        .page-title {
            font-size: 2.5rem;
            text-transform: uppercase;
            margin-bottom: 10px;
            position: relative;
            display: inline-block;
        }

        .page-title:after {
            content: '';
            position: absolute;
            bottom: -10px;
            left: 0;
            width: 100px;
            height: 5px;
            background-color: var(--accent);
        }

        .cart-summary {
            color: var(--text-light);
            font-size: 1.1rem;
        }

        /* 购物车商品列表 */
        .cart-items {
            background: white;
            border: 2px solid var(--text);
            box-shadow: 8px 8px 0 var(--concrete-light);
        }

        .cart-item {
            display: grid;
            grid-template-columns: 120px 1fr auto;
            gap: 20px;
            padding: 25px;
            border-bottom: 2px solid #eee;
        }

        .cart-item:last-child {
            border-bottom: none;
        }

        .item-image {
            width: 120px;
            height: 120px;
            border: 2px solid var(--text);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        .item-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .item-details {
            padding: 10px 0;
        }

        .item-name {
            font-size: 1.4rem;
            font-weight: 700;
            margin-bottom: 8px;
        }

        .item-series {
            color: var(--text-light);
            margin-bottom: 15px;
            font-size: 0.9rem;
        }

        .item-sku {
            font-size: 0.8rem;
            color: var(--text-light);
        }

        .item-controls {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: flex-end;
        }

        .item-price {
            font-size: 1.3rem;
            font-weight: 700;
            color: var(--accent);
        }

        .quantity-controls {
            display: flex;
            align-items: center;
            margin: 15px 0;
        }

        .qty-btn {
            width: 35px;
            height: 35px;
            background: var(--text);
            color: white;
            border: none;
            font-size: 1.2rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .qty-input {
            width: 50px;
            height: 35px;
            text-align: center;
            border: 2px solid var(--text);
            margin: 0 5px;
            font-weight: 700;
        }

        .remove-btn {
            background: none;
            border: none;
            color: var(--text-light);
            cursor: pointer;
            font-size: 0.9rem;
            text-decoration: underline;
        }

        .remove-btn:hover {
            color: var(--accent);
        }

        /* 购物车摘要 */
        .cart-summary {
            background: white;
            padding: 25px;
            border: 2px solid var(--text);
            box-shadow: 8px 8px 0 var(--concrete-light);
            position: sticky;
            top: 20px;
        }

        .summary-title {
            font-size: 1.5rem;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 2px solid #eee;
            text-transform: uppercase;
        }

        .summary-line {
            display: flex;
            justify-content: space-between;
            margin-bottom: 15px;
        }

        .summary-label {
            color: var(--text-light);
        }

        .summary-value {
            font-weight: 700;
        }

        .summary-total {
            display: flex;
            justify-content: space-between;
            margin: 20px 0;
            padding-top: 15px;
            border-top: 2px solid #eee;
            font-size: 1.3rem;
        }

        .total-label {
            font-weight: 700;
        }

        .total-value {
            font-weight: 900;
            color: var(--accent);
        }

        .promo-code {
            margin: 25px 0;
        }

        .promo-title {
            font-weight: 700;
            margin-bottom: 10px;
        }

        .promo-input {
            display: flex;
        }

        .promo-input input {
            flex: 1;
            padding: 12px;
            border: 2px solid var(--text);
            border-right: none;
        }

        .promo-btn {
            padding: 0 20px;
            background: var(--text);
            color: white;
            border: none;
            cursor: pointer;
            font-weight: 700;
        }

        .checkout-btn {
            display: block;
            width: 100%;
            padding: 18px;
            background-color: var(--accent);
            color: white;
            text-decoration: none;
            font-weight: bold;
            text-transform: uppercase;
            border: none;
            cursor: pointer;
            transition: all 0.3s;
            border: 2px solid var(--accent-dark);
            box-shadow: 5px 5px 0 var(--accent-dark);
            font-size: 1.1rem;
            text-align: center;
            margin-bottom: 15px;
        }

        .checkout-btn:hover {
            transform: translate(3px, 3px);
            box-shadow: 2px 2px 0 var(--accent-dark);
        }

        .continue-shopping {
            display: block;
            text-align: center;
            color: var(--text);
            text-decoration: none;
            font-weight: 600;
            margin-top: 20px;
        }

        .continue-shopping:hover {
            color: var(--accent);
        }

        /* 空购物车状态 */
        .empty-cart {
            text-align: center;
            padding: 60px 20px;
            background: white;
            border: 2px solid var(--text);
            box-shadow: 8px 8px 0 var(--concrete-light);
        }

        .empty-icon {
            font-size: 4rem;
            margin-bottom: 20px;
        }

        .empty-title {
            font-size: 1.8rem;
            margin-bottom: 15px;
        }

        .empty-text {
            color: var(--text-light);
            margin-bottom: 30px;
            max-width: 500px;
            margin-left: auto;
            margin-right: auto;
        }

        /* 推荐商品 */
        .recommended-products {
            margin-bottom: 60px;
        }

        .section-title {
            font-size: 2rem;
            text-align: center;
            margin-bottom: 40px;
            text-transform: uppercase;
            position: relative;
            padding-bottom: 15px;
        }

        .section-title:after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 100px;
            height: 5px;
            background-color: var(--accent);
        }

        .product-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 30px;
        }

        .product-card {
            background: white;
            padding: 20px;
            border: 2px solid var(--text);
            transition: all 0.3s;
            box-shadow: 8px 8px 0 var(--concrete-light);
        }

        .product-card:hover {
            transform: translate(5px, 5px);
            box-shadow: 3px 3px 0 var(--concrete-light);
        }

        .product-image {
            height: 250px;
            background-color: #f0f0f0;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--text);
            overflow: hidden;
        }

        .product-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .product-name {
            font-size: 1.5rem;
            margin-bottom: 10px;
            font-weight: 700;
        }

        .product-price {
            color: var(--accent);
            font-weight: 700;
            font-size: 1.2rem;
            margin-bottom: 15px;
        }

        /* 页脚 */
        footer {
            padding: 60px 0;
            text-align: center;
        }

        .footer-links {
            display: flex;
            justify-content: center;
            margin-bottom: 30px;
        }

        .footer-links a {
            margin: 0 15px;
            color: var(--text);
            text-decoration: none;
            font-weight: 600;
        }

        .social-icons {
            display: flex;
            justify-content: center;
            margin-bottom: 30px;
        }

        .social-icons a {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 50px;
            height: 50px;
            background-color: var(--text);
            color: white;
            margin: 0 10px;
            text-decoration: none;
            font-weight: bold;
            transition: all 0.3s;
        }

        .social-icons a:hover {
            transform: translateY(-5px);
            background-color: var(--accent);
        }

        .copyright {
            color: var(--text-light);
        }

        /* 响应式设计 */
        @media (max-width: 900px) {
            .cart-container {
                grid-template-columns: 1fr;
            }

            .cart-item {
                grid-template-columns: 100px 1fr;
                grid-template-rows: auto auto;
            }

            .item-controls {
                grid-column: 1 / -1;
                flex-direction: row;
                align-items: center;
                margin-top: 15px;
            }

            .item-price {
                margin-right: auto;
                margin-left: 20px;
            }

            nav ul {
                flex-wrap: wrap;
            }

            nav li {
                margin: 0 15px 10px 0;
            }
        }

        @media (max-width: 600px) {
            header {
                flex-direction: column;
                text-align: center;
            }

            .logo {
                margin-bottom: 20px;
            }

            nav ul {
                justify-content: center;
            }

            .cart-item {
                grid-template-columns: 1fr;
                text-align: center;
            }

            .item-image {
                margin: 0 auto;
            }

            .item-controls {
                flex-direction: column;
                gap: 15px;
            }

            .item-price {
                margin: 0;
            }

            .page-title {
                font-size: 2rem;
            }
        }
    </style>
</head>

<body>
    <div class="container">
        <header>
            <div class="logo">BRUTAL<span>TOYS</span></div>
            <nav>
                <ul>
                    <li><a href="index.html">首页</a></li>
                    <li><a href="product_list_2.html">产品</a></li>
                    <li><a href="artists.html">艺术家</a></li>
                    <li><a href="about.html">关于</a></li>
                    <li><a href="contact.html">联系</a></li>
                    <li><a href="cart.html" class="active">购物车(3)</a></li>
                </ul>
            </nav>
        </header>

        <div class="page-header">
            <h1 class="page-title">购物车</h1>
            <p class="cart-summary">3件商品</p>
        </div>

        <div class="cart-container">
            <div class="cart-items">
                <div class="cart-item">
                    <div class="item-image">
                        <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Crect width='120' height='120' fill='%239E9E9E'/%3E%3Cpath d='M60,50 L70,70 L60,90 L50,70 Z' fill='%23616161'/%3E%3Ccircle cx='60' cy='50' r='8' fill='%23FF5252'/%3E%3Crect x='55' y='85' width='10' height='15' fill='%23424242'/%3E%3C/svg%3E"
                            alt="混凝土巨人 #07">
                    </div>
                    <div class="item-details">
                        <h3 class="item-name">混凝土巨人 #07</h3>
                        <p class="item-series">混凝土巨人系列</p>
                        <p class="item-sku">产品编号: BT-CG-007</p>
                    </div>
                    <div class="item-controls">
                        <div class="item-price">¥899</div>
                        <div class="quantity-controls">
                            <button class="qty-btn">-</button>
                            <input type="number" class="qty-input" value="1" min="1">
                            <button class="qty-btn">+</button>
                        </div>
                        <button class="remove-btn">删除</button>
                    </div>
                </div>

                <div class="cart-item">
                    <div class="item-image">
                        <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Crect width='120' height='120' fill='%23E0E0E0'/%3E%3Cpolygon points='60,40 80,70 40,70' fill='%239E9E9E'/%3E%3Crect x='50' y='70' width='20' height='30' fill='%23616161'/%3E%3C/svg%3E"
                            alt="几何兽 - 灰烬">
                    </div>
                    <div class="item-details">
                        <h3 class="item-name">几何兽 - 灰烬</h3>
                        <p class="item-series">几何兽系列</p>
                        <p class="item-sku">产品编号: BT-GB-012</p>
                    </div>
                    <div class="item-controls">
                        <div class="item-price">¥759</div>
                        <div class="quantity-controls">
                            <button class="qty-btn">-</button>
                            <input type="number" class="qty-input" value="1" min="1">
                            <button class="qty-btn">+</button>
                        </div>
                        <button class="remove-btn">删除</button>
                    </div>
                </div>

                <div class="cart-item">
                    <div class="item-image">
                        <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Crect width='120' height='120' fill='%23EEEEEE'/%3E%3Crect x='40' y='40' width='40' height='60' fill='%239E9E9E' stroke='%23616161' stroke-width='3'/%3E%3Cline x1='40' y1='55' x2='80' y2='55' stroke='%23616161' stroke-width='2'/%3E%3Cline x1='40' y1='70' x2='80' y2='70' stroke='%23616161' stroke-width='2'/%3E%3C/svg%3E"
                            alt="未完成系列 #02">
                    </div>
                    <div class="item-details">
                        <h3 class="item-name">未完成系列 #02</h3>
                        <p class="item-series">未完成系列</p>
                        <p class="item-sku">产品编号: BT-US-002</p>
                    </div>
                    <div class="item-controls">
                        <div class="item-price">¥699</div>
                        <div class="quantity-controls">
                            <button class="qty-btn">-</button>
                            <input type="number" class="qty-input" value="1" min="1">
                            <button class="qty-btn">+</button>
                        </div>
                        <button class="remove-btn">删除</button>
                    </div>
                </div>
            </div>

            <div class="cart-summary">
                <h3 class="summary-title">订单摘要</h3>

                <div class="summary-line">
                    <span class="summary-label">小计</span>
                    <span class="summary-value">¥2,357</span>
                </div>

                <div class="summary-line">
                    <span class="summary-label">运费</span>
                    <span class="summary-value">¥50</span>
                </div>

                <div class="summary-line">
                    <span class="summary-label">税费</span>
                    <span class="summary-value">¥235.70</span>
                </div>

                <div class="summary-total">
                    <span class="total-label">总计</span>
                    <span class="total-value">¥2,642.70</span>
                </div>

                <div class="promo-code">
                    <div class="promo-title">优惠码</div>
                    <div class="promo-input">
                        <input type="text" placeholder="输入优惠码">
                        <button class="promo-btn">应用</button>
                    </div>
                </div>

                <button class="checkout-btn">前往结账</button>
                <a href="products.html" class="continue-shopping">继续购物</a>
            </div>
        </div>

        <div class="recommended-products">
            <h2 class="section-title">你可能也喜欢</h2>
            <div class="product-grid">
                <div class="product-card">
                    <div class="product-image">
                        <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='250' viewBox='0 0 280 250'%3E%3Crect width='280' height='250' fill='%23F5F5F5'/%3E%3Ccircle cx='140' cy='100' r='60' fill='%239E9E9E'/%3E%3Crect x='110' y='160' width='60' height='70' fill='%23616161'/%3E%3Cpath d='M110,160 L170,160 L140,100 Z' fill='%23E0E0E0'/%3E%3C/svg%3E"
                            alt="野蛮天使">
                    </div>
                    <h3 class="product-name">野蛮天使</h3>
                    <p class="product-price">¥1,280</p>
                    <a href="#" class="checkout-btn" style="font-size: 1rem;">加入购物车</a>
                </div>

                <div class="product-card">
                    <div class="product-image">
                        <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='250' viewBox='0 0 280 250'%3E%3Crect width='280' height='250' fill='%23FAFAFA'/%3E%3Ccircle cx='140' cy='100' r='50' fill='%23616161'/%3E%3Crect x='100' y='100' width='80' height='80' fill='%239E9E9E'/%3E%3Ccircle cx='120' cy='70' r='15' fill='%23FF5252'/%3E%3Ccircle cx='160' cy='70' r='15' fill='%23FF5252'/%3E%3C/svg%3E"
                            alt="混凝土巨人 #08">
                    </div>
                    <h3 class="product-name">混凝土巨人 #08</h3>
                    <p class="product-price">¥949</p>
                    <a href="#" class="checkout-btn" style="font-size: 1rem;">加入购物车</a>
                </div>

                <div class="product-card">
                    <div class="product-image">
                        <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='250' viewBox='0 0 280 250'%3E%3Crect width='280' height='250' fill='%23F0F0F0'/%3E%3Cpath d='M140,80 C180,80 210,120 210,170 C210,200 180,220 140,220 C100,220 70,200 70,170 C70,120 100,80 140,80 Z' fill='%239E9E9E'/%3E%3Crect x='130' y='170' width='20' height='40' fill='%23616161'/%3E%3C/svg%3E"
                            alt="几何兽 - 磐石">
                    </div>
                    <h3 class="product-name">几何兽 - 磐石</h3>
                    <p class="product-price">¥799</p>
                    <a href="#" class="checkout-btn" style="font-size: 1rem;">加入购物车</a>
                </div>
            </div>
        </div>
    </div>

    <footer>
        <div class="container">
            <div class="footer-links">
                <a href="contact.html">联系我们</a>
                <a href="terms.html">条款条件</a>
                <a href="guide.html">购买指南</a>
                <a href="delivery.html">配送信息</a>
                <a href="help.html">帮助中心</a>
            </div>
            <div class="social-icons">
                <a href="#">IG</a>
                <a href="#">TW</a>
                <a href="#">FB</a>
                <a href="#">YT</a>
            </div>
            <p class="copyright">© 2023 BRUTAL TOYS. 保留所有权利。</p>
        </div>
    </footer>

    <script>
        document.addEventListener('DOMContentLoaded', function () {
            // 数量选择器功能
            const qtyMinusBtns = document.querySelectorAll('.qty-btn:first-child');
            const qtyPlusBtns = document.querySelectorAll('.qty-btn:last-child');
            const qtyInputs = document.querySelectorAll('.qty-input');
            const removeBtns = document.querySelectorAll('.remove-btn');

            // 为每个数量按钮添加事件监听器
            qtyMinusBtns.forEach((btn, index) => {
                btn.addEventListener('click', function () {
                    let value = parseInt(qtyInputs[index].value);
                    if (value > 1) {
                        qtyInputs[index].value = value - 1;
                        updateCartSummary();
                    }
                });
            });

            qtyPlusBtns.forEach((btn, index) => {
                btn.addEventListener('click', function () {
                    let value = parseInt(qtyInputs[index].value);
                    if (value < 10) {
                        qtyInputs[index].value = value + 1;
                        updateCartSummary();
                    }
                });
            });

            // 删除商品功能
            removeBtns.forEach(btn => {
                btn.addEventListener('click', function () {
                    const cartItem = this.closest('.cart-item');
                    cartItem.style.opacity = '0';
                    setTimeout(() => {
                        cartItem.remove();
                        updateCartItemCount();
                        updateCartSummary();
                    }, 300);
                });
            });

            // 更新购物车商品数量显示
            function updateCartItemCount() {
                const cartItems = document.querySelectorAll('.cart-item');
                const cartLink = document.querySelector('nav a[href="cart.html"]');
                if (cartLink && cartItems.length === 0) {
                    // 如果购物车为空，显示空状态
                    showEmptyCart();
                } else if (cartLink) {
                    cartLink.textContent = `购物车(${cartItems.length})`;
                }
            }

            // 显示空购物车状态
            function showEmptyCart() {
                const cartContainer = document.querySelector('.cart-container');
                cartContainer.innerHTML = `
                    <div class="empty-cart">
                        <div class="empty-icon">🛒</div>
                        <h2 class="empty-title">你的购物车是空的</h2>
                        <p class="empty-text">看起来你还没有添加任何商品到购物车。浏览我们的收藏，找到你喜欢的粗野主义潮玩。</p>
                        <a href="products.html" class="checkout-btn" style="display: inline-block; width: auto; padding: 15px 30px;">浏览产品</a>
                    </div>
                `;

                // 隐藏推荐商品区域
                document.querySelector('.recommended-products').style.display = 'none';
            }

            // 更新购物车摘要
            function updateCartSummary() {
                // 这里可以添加计算总价的逻辑
                console.log('更新购物车摘要');
            }

            // 优惠码应用功能
            const promoBtn = document.querySelector('.promo-btn');
            if (promoBtn) {
                promoBtn.addEventListener('click', function () {
                    const promoInput = document.querySelector('.promo-input input');
                    if (promoInput.value.trim() !== '') {
                        alert(`优惠码 "${promoInput.value}" 已应用`);
                        promoInput.value = '';
                    } else {
                        alert('请输入优惠码');
                    }
                });
            }
        });
    </script>
</body>

</html>